ostree-prepare-root.service: Run earlier in initrd
authorJonathan Lebon <jonathan@jlebon.com>
Thu, 18 Oct 2018 20:44:05 +0000 (16:44 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 19 Oct 2018 15:41:10 +0000 (15:41 +0000)
commita4a49724d6f898fd5e76bd6de49d36f7ed8d237e
tree83163020addcf6290155171cb6d3147c7d186eb7
parentae99b9ccdc0ba0b75f3877461d5cc2b3b49fd9be
ostree-prepare-root.service: Run earlier in initrd

Previously, we were preparing the root very late in the boot process;
right before we switch root. The issue with that is that most services
in the initrd that run `After=initrd-root-fs.target` expect that
`/sysroot` already points to the rootfs we'll be pivoting to. Running
this late violates that assumption.

This patch fixes this by making `ostree-prepare-root.service` instead
run right after `sysroot.mount` (the physical sysroot mounted by
systemd) but still before `initrd-root-fs.target` (which is the target
signalling that `/sysroot` is now valid and ready).

This should make it easier to integrate OSTree with other initrd
services such as Ignition.

Related: https://github.com/dustymabe/ignition-dracut/issues/20

Closes: #1759
Approved by: cgwalters
src/boot/dracut/module-setup.sh
src/boot/ostree-prepare-root.service